import actionTypes from "./actionTypes"
import http from '../../service/http'
export function LoadVarietyAction(payload){
  return{
    type:actionTypes.LOAD_VARIETY_LIST,
    payload:payload,
  }
}
export function LoadVarietyActionAsync(payload){
  return dispatch=>{
    return http.varietyList(payload).then((res)=>{
      if(res.code!==200)return
      dispatch(LoadVarietyAction(res.data))
    })
  }
}
export function UpdateVarietyActionAsync(payload){
  return dispatch=>{
    return http.varietyUpdate(payload).then((res)=>{
      if(res.code!==200)return
    })
  }
}
// export function AddVarietyActionAsync(payload){
//   return dispatch=>{
//     return http.varietyAdd(payload)
//   }
// }